import express from 'express'
import * as dataServer from '../../controllers/data.js'

const router = express.Router();

//15.获取统计数据
router.get('/info', async (req, res) => {
    let data = await dataServer.selectDataInfo();
    res.send({
        code: 200,
        msg: "获取成功",
        data
    })
});


//16.日新增文章数量统计
router.get('/article', async (req, res) => {
    let data = await dataServer.selectDataArticles();
    res.send({
        code: 200,
        msg: "获取成功",
        data
    })
});


//17.各类型文章数量统计
router.get('/category', async (req, res) => {
    let data = await dataServer.selectDataCategory();
    res.send({
        code: 200,
        msg: "获取成功",
        data
    })
});


//18.日文章访问量
router.get('/visit', async (req, res) => {
    let data = await dataServer.selectDataVisit();
    res.send({
        code: 200,
        msg: "获取成功",
        data
    })
});


export default router;